<?php
$con = mysql_connect('127.0.0.1', 'root', '123456');
mysql_query("SET NAMES 'UTF8'");
mysql_select_db('zsy');

function query($sql) {
	return mysql_query($sql);
}

function closeConnection() {
	if (isset($con)) {
		mysql_close($con);
	}
}

function fetch($rs){
	$data = array();
	while($row = mysql_fetch_assoc($rs)){
		array_push($data, $row);
	}
	return $data;
}
function fetch_one($rs){
	$row = mysql_fetch_row($rs);
	return $row[0];
}